<template>
<div>
  <div class="map" style="border: 0; height:calc(100vh - 64px); width: 100%">
    <iframe
      id="parentId"
      :src="appkey + code + ' ' + token"
      style="border: 0; height: 100%; width: 100%"
    />
  </div>
</div>
</template>

<script>
import Cookies from 'js-cookie'
import { getUserByToken } from '@/api/login'
export default {
  data() {
    return{
      appkey: 'http://192.168.0.119:8889/permission-system/index.html#/home?token=',
      code: '',
      token: ''
    }
  },
  mounted() {
    this.getUserByToken();
  },
  methods: {
    getUserByToken() {
      let req = {
        token: Cookies.get('gisinfo')
      }
      getUserByToken(req)
        .then(res => {
          let { system, token } = res.data.result;
          this.code = system;
          this.token = token;
        })
    }
  }

}
</script>

